def decorator(cls):             # 传入一个类即cls
    cls.name = "decorator_name"     # 设置一个类属性
    return cls    

@decorator
class Animal:
    pass

animal = Animal()
print(animal.name)